/******************************************************************************
 * (C) Copyright 2013 Atech-Automotive
 * FILE NAME:    uds_diag_ioctrl_fun.h
 * DESCRIPTION:
 * 
 * DATE BEGUN:   2015/06/17
 * BY:           hui.pang
 * PRODUCT NAME:
 * APPLICATION:
 * TARGET H/W:
 * DOC REF:
 *****************************************************************************
 */

#ifndef _UDS_DIAG_IOCTRL_FUN_H_
#define _UDS_DIAG_IOCTRL_FUN_H_

/*****************************************************************************
** #include 
*****************************************************************************/
#include "system.h"
#include "uds_diag_appl_cfg.h"

#pragma CODE_SEG  OTHER_ROM


/*****************************************************************************
** typedef
*****************************************************************************/  
typedef enum
{
    IO_CTRL_CMD_RETURN_TO_ECU           = 0x00,
    IO_CTRL_CMD_RESET_TO_DEFAULT        = 0x01,
    IO_CTRL_CMD_FREEZE_CURRENT_STATE    = 0x02,
    IO_CTRL_CMD_SHORT_TERM_ADJUSTMENT   = 0x03,
} Uds_IOCtrl_Cmd_E;


extern void UdsIOCtrlFun_ExitIoCtrlState( void );

/*****************************************************************************
** #config
*****************************************************************************/


/*****************************************************************************
** #define
*****************************************************************************/
#define IO_CTRL_TIME_LONG                   0xFFFF
#define IO_CTRL_TIME_10M                    60000 /* 60000*10ms = 10min */
#define IO_CTRL_TIME_6S                     600 /* 600*10ms = 6s */
#define IO_CTRL_TIME_5S                     500 /* 600*10ms = 6s */
#define IO_CTRL_TIME_2S                     200 /* 200*10ms = 2s */
#define IO_CTRL_TIME_1S                     100 /* 100*10ms = 1s */
#define IO_CTRL_TIME_500MS                  50  /* 5 *10ms = 500ms */
#define IO_CTRL_TIME_300MS                  30  /* 3 *10ms = 300ms */   


extern UINT8 UdsIOCtrlFun_OutPut1           ( Uds_IOCtrl_Cmd_E cmd, UINT8 *p_u8_data );

extern UINT8 UdsIOCtrlFun_Digital_Input1    ( Uds_IOCtrl_Cmd_E cmd, UINT8 *p_u8_data );

    
#define DIAG_IOCTL_BY_ID_TABLE    


/****************************************************************************/

#pragma CODE_SEG  DEFAULT

#endif

/*****************************************************************************
** End File
*****************************************************************************/

